home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- this._visible = active;
- this.gotoAndStop(_parent.current_level);
- if(active)
- {
- x = calculate_x(t);
- y = calculate_y(t);
- this._x = x;
- this._y = y;
- dx = calculate_x(t + inc) - x;
- dy = calculate_y(t + inc) - y;
- this._rotation = Math.atan2(dy,dx) * 180 / 3.141592653589793;
- if(this.hitTest(_parent.player) && _parent.player.status != "hit")
- {
- _parent.score -= 25;
- _parent.num_lives--;
- t = 1;
- if(_parent.num_lives == 0)
- {
- _parent.prompts.gotoAndPlay("game_over");
- _parent.player.status = "game over";
- _parent.player.previous_status = "game over";
- _parent.player.status = "game over";
- _parent.player.gotoAndPlay(2);
- }
- else
- {
- _parent.player.previous_status = _parent.player.status;
- _parent.player.status = "hit";
- _parent.player.gotoAndPlay(2);
- }
- }
- t += inc;
- if(1 < t || t < 0)
- {
- current_time++;
- if(current_time >= num_times)
- {
- t = 0;
- current_time = 0;
- active = false;
- var j = 0;
- while(j < 5)
- {
- base_points[j].x = _parent.xctr - (base_points[j].x - _parent.xctr);
- j++;
- }
- _parent.create_boss(_parent.current_level,_parent.xctr,_parent.yctr);
- _parent.current_level = _parent.current_level + 1;
- _parent.current_round = 1;
- _parent.player.status = "boss";
- }
- else
- {
- t = Math.round(Math.random());
- if(t == 0 && inc < 0)
- {
- inc *= -1;
- inc += 0.0005;
- }
- else if(t == 1 && 0 < inc)
- {
- inc *= -1;
- inc -= 0.0005;
- }
- var j = 0;
- while(j < 5)
- {
- control_points[j].x = base_points[j].x + Math.random() * 150 - 75;
- control_points[j].y = base_points[j].y + Math.random() * 150 - 75;
- j++;
- }
- }
- }
- }
- }
-